package com.mail.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serializable;

/**
 *  传递给发送邮件的参数
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SendEmailDto implements Serializable{
    private static final long serialVersionUID = 1L;

    /**
     *发送邮件服务器，发送端口号：25，465，587
     */
    private String port;

    /**
     *发件人邮箱地址
     */
    private String sendMail;

    /**
     *发件人邮箱授权码
     */
    private String sendMailPwd;

    /**
     *邮件标题
     */
    private String title;

    /**
     *邮件内容
     */
    private String content;

    /**
     *发件人名称
     */
    private String sendMailName;

    /**
     *附件
     */
    private MultipartFile files;

    /**
     *收件人
     */
    private String[] receiveMail;

    /**
     *发件人邮箱的 SMTP 服务器地址, 必须准确, 不同邮件服务器地址不同, 一般(只是一般, 绝非绝对)格式为: smtp.xxx.com
     */
    private String sendSMTPHost;

    /**
     *收件人昵称(可选)
     */
    private String receiveMailName;

    public SendEmailDto(String port, String sendMail, String sendMailPwd, String title, String content, String sendMailName, String[] receiveMail, String sendSMTPHost, String receiveMailName) {
        this.port = port;
        this.sendMail = sendMail;
        this.sendMailPwd = sendMailPwd;
        this.title = title;
        this.content = content;
        this.sendMailName = sendMailName;
        this.receiveMail = receiveMail;
        this.sendSMTPHost = sendSMTPHost;
        this.receiveMailName = receiveMailName;
    }
}
